#!/usr/bin/env bash
# Network info

ifaces=$(ls /sys/class/net | grep -E '^(eth|wlan|enp|wlp|eno)')
array=($ifaces)
i=0
size=${#array[@]}
while [ $i -lt $(( size -1 )) ]; do
    ip=$(ip addr show "${array[$i]}" | sed -nE 's,inet\s(([[:digit:]]\.?)+).*,\1,p')
    printf "%s(%s) " "${array[$i]}" $ip
    i=$(( i + 1 ))
done
ip=$(ip addr show "${array[$i]}" | sed -nE 's,inet\s(([[:digit:]]\.?)+).*,\1,p')
# printf "<span color='#00ffbb'>%s-%s</span>\n" "${array[$i]}" $ip
printf "<span color='#00ffbb'>%s</span>\n" $ip
